from tkinter import *

tk = Tk()
tk.title('用例生成器')
tk.geometry('500x500')

def add_btn():
    b = Button(tk, text='button1',  command=callback)
    #Button(tk, text='button1',  command=lambda: main(1)) 传参形式
    b.pack()

def callback():
    print(111)

def layout():
    b = Button(tk, text='button1',  command=callback)
    b.place(x=275,y=0)

def file_open():
    '''上传文件，返回路径'''
    import tkinter.filedialog
    excel_path = tkinter.filedialog.askopenfilename(title='上传文件',initialdir="./",
                                           filetypes=[ ('.xlsx','.xlsx')])

def confirm_box():
    '''确认框'''
    import tkinter.messagebox
    r = tkinter.messagebox.askokcancel(title = '提示',message='未选择文件或节点')

def tip_box():
    import tkinter.messagebox
    tkinter.messagebox.showinfo('提示','创建成功！')

def Treeview():
    '''可展开列表'''
    from tkinter import ttk
    treeview = ttk.Treeview(tk,height=15,columns=[1],show='tree')
    treeview.insert(pid,0,id,value=(text))
    treeview.bind('<ButtonRelease-1>', treeviewClick)
    treeview.pack()

def treeviewClick(event):
    '''返回节点id'''
    selc_node = treeview.selection()[0]

tip_box()
tk.mainloop()